<div class="fui-page">
    <div class='fui-content'>
			<div class="jy-content">
			<div ng-repeat="item in pagedata.list" class="fui-cell-group radius">
				<div class='fui-cell'>
					<div class='fui-cell-info'>
					   <div class="bold">{{item.kabao.title}}</div>
					   <div class="gray">{{item.kabao.desc}}</div>
					   <div class="bold">卡号：{{item.sn}} 
					   <span class='label label-success' ng-click="pagedata.posterimg=item.poster;pagedata.showposter=true;">查看卡片</span>
					   </div>
					</div>
					<div ng-if="item.status==0 || item.status==2" class='fui-cell-remark noremark'>
					<span class="btn btn-sm btn-success-o" href="javascript:;" ng-click="post({'id':item.id},'/songlog/del/')">删除</span>
					</div>
				</div>
				<div class='fui-cell'>
					<div ng-if="item.status==1" class='fui-cell-info'>
					   <div class="bold">领取人:{{item.member.nickname}}</div>
					   <div class="gray">领取时间:{{item.gettime}}</div>
					   <div class="gray">生成时间:{{item.uptime}}</div>
					</div>
					<div ng-if="item.status==0" class='fui-cell-info'>
					   <div class="bold">有效期:{{item.endtime}}</div>
					   <div class="gray">生成时间:{{item.uptime}}</div>
					</div>
					<div class='fui-cell-remark noremark'>
					   {{item.statustitle}}
					</div>
				</div>
			</div>
			<div ng-if="pagedata.list.length<=0" class="content-empty">
				<i class='icon icon-chakanpingjia'></i>
				<div>暂无相关记录</div>
			</div>
			<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
			</div>
	</div>
	<div ng-if="pagedata.order.id>0" class="fui-navbar">
		<div class="nav-item" style="line-height: 1rem;padding: 0.5rem;font-size:0.6rem">
		<div class="bold" style="font-size:0.6rem">已生成卡片{{pagedata.order.lognum || 0}}张</div>
		<div>总可生成{{pagedata.order.total || 0}}张</div>
		</div>
		<div ng-show="pagedata.order.status==0 && pagedata.order.lslognum>0" class="nav-item btn buybtn">
		<span style="margin-top:0.6rem;margin-right:0.5rem" href="javascript:;" ng-click="pagedata.showposter=true;pagedata.upposter()">生成卡片</span>
		</div>
		<div ng-show="pagedata.order.status!=0 || pagedata.order.lslognum<=0" class="nav-item btn buybtn" style="background:#ddd">
		<span style="margin-top:0.6rem;margin-right:0.5rem">暂时不能生成卡片</span>
		</div>
	</div>
</div>
<div ng-if="pagedata.showposter" class="popup">
		<div class="popup-body">
			<div class="popup-center" style="top:42%">
				<i class="closed icon icon-cuowu" ng-click="pagedata.showposter=false"></i>
				<div class="fui-content c" style="height:auto;border: 1px solid #fdd8d6;border-radius:0.3rem;padding-bottom:0;background:#fff">
					<img ng-src="{{pagedata.posterimg ||'../addons/jy_shoplibao/resource/images/cardbg.png'}}" style="border-radius:0.3rem;width:100%;"/>
					<a class="btn btn-sm btn-danger-o external" style="line-height: 1.1rem;border-radius:1rem;margin:0.2rem;font-size:0.65rem;">长按保存图片</a>
				</div>
			</div>
		</div>
</div>
<script>
	scope.tool.get_list('jy_shoplibao/songlog/list/',true);
	scope.pagedata.scroll_bottom=function(){
			scope.tool.get_list('jy_shoplibao/songlog/list/');
	}
</script>
<script type="text/javascript">
scope.pagedata.upposter=function(){
	scope.get('jy_shoplibao/orderitem/upposter/orderid='+scope.pagedata.order.id,function(res){
		console.log(res)
		scope.pagedata.posterimg=res.posterimg;
		scope.tool.get_list('jy_shoplibao/songlog/list/',true);
	});
}
</script>